package validator

import (
	"github.com/go-playground/validator/v10"
	"reflect"
)

func CheckName(v *validator.Validate, topStruct reflect.Value, currentStructOrField reflect.Value,
	field reflect.Value, fieldType reflect.Type, fieldKind reflect.Kind, param string) bool {
	if value, ok := field.Interface().(string); ok {
		// 字段不能为空，并且不等于  admin
		return value != "" && !("admin" == value)
	}
	return true
}
